<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>店铺中心</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui-pull-refresh.css" />
    <style>
        html,
        body {
            width: 100%;
            min-height: 100%;
            background: #ffffff;
        }

        .aui-active .aui-bar-tab-label {
            color: #f5a51c
        }

        .login {
            height: 10rem;
            background-image: -webkit-linear-gradient(0deg, #f5c674, #ff8000);
            /*background-image: url(../../image/personal_bkg.jpg);background-repeat: no-repeat; background-size: cover;*/
            position: relative;
        }

        .login .personal_logo {
            width: 3rem;
            height: 3rem;
            border: 1px solid #fff;
        }

        .login .userinfo .title {
            font-size: 0.8rem;
            color: #fff;
        }
        /* 设置条目 */

        .item {
            height: 3rem;
            line-height: 3rem;
            padding-left: 0.7rem;
            background-color: #fff;
        }

        .item_ico {
            float: left;
            width: 2.3rem;
            padding: 0.7rem 0.7rem 0.7rem 0;
        }

        .item_arrow {
            float: right;
            width: 1.5rem;
            padding: 1rem 0.7rem 1rem 0;
        }

        .item span {
            font-size: 0.7rem;
        }
        .shopBgTitle{
             background:#ff8000;
        }
        [v-cloak] {
            display: none;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <div class="aui-refresh-content">
            <div class="aui-content login" style="padding-top:25px">
                <div class="" tapmode="">
                    <div class="userinfo">
                        <div class="userHerder">
                            <a class="aui-pull-left" @click="goback()">
                                <span class="aui-iconfont aui-icon-left" style="color:#fff"></span>
                            </a>
                            <div class="userMy" style="font-size:0.7rem">店铺中心</div>
                            <img src="../../image/my/m56.png" alt="" onclick="tost_code()">
                        </div>
                        <div class="userContent" v-if="dataInfo.store_info" style="display: flex;align-items: center;justify-content: space-between;" @click="storeTheData()">
                            <div class="userimg">
                                <div class="personal_logo" :style="{background: 'url(' + dataInfo.store_info.logo + ') center/cover no-repeat',borderRadius:0.5+'rem'}" v-show="dataInfo.store_info.logo!=''"></div>
                                <div class="personal_logo" style="background: url('../../image/my/LOGO.png') center/cover no-repeat;border-radius:0.5rem" v-show="dataInfo.store_info.logo==''"></div>
                                <div>
                                    <div class="userMy" style="font-size:0.8rem">{{dataInfo.store_info.name}}</div>
                                    <div class="userMy" style="font-size:0.7rem">{{dataInfo.store_info.mobile}}</div>
                                </div>
                            </div>
                            <div class="userMy" onclick="">
                                <img src="../../image/my/back.png" alt="" style="transform:rotateZ(180deg);width:0.5rem">
                            </div>
                        </div>
                    </div>
                </div>

            </div>
            <ul class="aui-list aui-media-list">
                <li class="aui-list-item aui-list-item-middle" onclick="orderNumber()">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14 index_five_my">总订单数</div>
                                <div class="aui-list-item-right aui-font-size-14" style="color:#000">{{dataInfo.all_order_count}}</div>
                            </div>

                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14 index_five_my">今日订单数</div>
                                <div class="aui-list-item-right aui-font-size-14" style="color:#000">{{dataInfo.today_order_count}}</div>
                            </div>

                        </div>
                    </div>
                </li>
            </ul>
            <section class="aui-grid aui-margin-b-15">
                <div class="aui-row">
                    <div class="aui-col-xs-4" style="border:1px solid #eee;border-top:none">
                        <div class="aui-font-size-20">{{dataInfo.pending_payment_order}}</div>
                        <div class="aui-grid-label aui-font-size-12">待付款</div>
                    </div>
                    <div class="aui-col-xs-4" style="border:1px solid #eee;border-top:none;border-left:none;">
                        <div class="aui-font-size-20">{{dataInfo.yesterday_deal_amount | moneyFilter}}</div>
                        <div class="aui-grid-label aui-font-size-12">昨日成交金额</div>
                    </div>
                    <div class="aui-col-xs-4" style="border:1px solid #eee;border-top:none;border-left:none;">
                        <div class="aui-font-size-20">{{dataInfo.pending_consignment_order}}</div>
                        <div class="aui-grid-label aui-font-size-12">待发货</div>
                    </div>
                    <div class="aui-col-xs-4" style="border:1px solid #eee;border-top:none">
                        <div class="aui-font-size-20">{{dataInfo.pending_consignment_order }}</div>
                        <div class="aui-grid-label aui-font-size-12">待发货</div>
                    </div>
                    <div class="aui-col-xs-4" style="border:1px solid #eee;border-top:none;border-left:none;">
                        <div class="aui-font-size-20">{{dataInfo.pending_evaluation_order}}</div>
                        <div class="aui-grid-label aui-font-size-12">待评价</div>
                    </div>
                    <div class="aui-col-xs-4" style="border:1px solid #eee;border-top:none;border-left:none;">
                        <div class="aui-font-size-20">{{dataInfo.after_sale_order}}</div>
                        <div class="aui-grid-label aui-font-size-12">退款/售后</div>
                    </div>
                </div>
            </section>
            <div class="user_nav_line"></div>
            <ul class="aui-list aui-media-list">
                <li class="aui-list-item aui-list-item-middle shopBgTitle">
                    <div class="aui-media-list-item-inner" style="padding-left: 0;">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14 "><div style="border-left:2px solid #f23030;padding-left: 0.2rem;height:0.7rem;display:inline-block;vertical-align: middle;"></div>商品信息</div>
                            </div>

                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle" style="padding-left: 0;margin-left: 0.75rem;" @click="commodityControl(dataInfo.all_goods_count)">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-inner aui-list-item-arrow">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14">总商品数</div>
                                <div class="aui-list-item-right">{{dataInfo.all_goods_count}}</div>
                            </div>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle" style="padding-left: 0;margin-left: 0.75rem;" @click="share_commodity(dataInfo.distribution_goods_count)">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-inner aui-list-item-arrow">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14">分享商品</div>
                                <div class="aui-list-item-right">{{dataInfo.distribution_goods_count}}</div>
                            </div>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle" style="padding-left: 0;margin-left: 0.75rem;" @click="exchange_commodity(dataInfo.exchange_goods_count)">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-inner aui-list-item-arrow">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14">兑换商品</div>
                                <div class="aui-list-item-right">{{dataInfo.exchange_goods_count}}</div>
                            </div>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle" style="margin-left: 0.75rem;padding-left: 0;" onclick="uploadCommodity()">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-inner aui-list-item-arrow">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14">商品上传</div>
                            </div>
                        </div>
                    </div>
                </li>
            </ul>
            <div class="user_nav_line"></div>
            <ul class="aui-list aui-media-list">
                <li class="aui-list-item aui-list-item-middle  shopBgTitle">
                    <div class="aui-media-list-item-inner" style="padding-left: 0;">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14"><div style="border-left:2px solid #f23030;padding-left: 0.2rem;height:0.7rem;display:inline-block;vertical-align: middle;"></div>店铺财产</div>
                            </div>

                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle" style="padding-left: 0;margin-left: 0.75rem;" onclick="storeTheBalance()">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-inner aui-list-item-arrow">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14">店铺余额</div>
                                <div class="aui-list-item-right">{{dataInfo.store_wallet | moneyFilter}}元</div>
                            </div>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle" style="margin-left: 0.75rem;padding-left: 0;" @click="servercharge">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-inner aui-list-item-arrow">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14">店铺服务费</div>
                                <div class="aui-list-item-right">{{dataInfo.store_service_charge | moneyFilter}}元/年</div>
                            </div>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle" style="margin-left: 0.75rem;padding-left: 0;" onclick="storeIntegral()">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-inner aui-list-item-arrow">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14">店铺积分</div>
                                <div class="aui-list-item-right">{{dataInfo.store_integral | moneyFilter}}</div>
                            </div>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle" style="margin-left: 0.75rem;padding-left: 0;" onclick="convertibleCurrency()">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-inner aui-list-item-arrow">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14">店铺兑换币</div>
                                <div class="aui-list-item-right">{{dataInfo.store_exchange | moneyFilter}}</div>
                            </div>
                        </div>
                    </div>
                </li>
            </ul>
            <div class="user_nav_line"></div>
            <ul class="aui-list aui-media-list">
                <li class="aui-list-item aui-list-item-middle shopBgTitle">
                    <div class="aui-media-list-item-inner" style="padding-left: 0;">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14"><div style="border-left:2px solid #f23030;padding-left: 0.2rem;height:0.7rem;display:inline-block;vertical-align: middle;"></div>店铺收益</div>
                            </div>

                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle" style="margin-left: 0.75rem;padding-left: 0;" onclick="storeTurnover()">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-inner aui-list-item-arrow">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14">当前营业额</div>
                                <div class="aui-list-item-right">{{dataInfo.turnover_wallet_amount | moneyFilter}}元</div>
                            </div>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle" style="margin-left: 0.75rem;padding-left: 0;" onclick="Integralbenefits()">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-inner aui-list-item-arrow">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14">积分收益</div>
                                <div class="aui-list-item-right">{{dataInfo.turnover_integral_amount | moneyFilter}}</div>
                            </div>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-list-item-middle" style="margin-left: 0.75rem;padding-left: 0;" onclick="exchangeEarnings()">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-inner aui-list-item-arrow">
                            <div class="aui-list-item-text">
                                <div class="aui-list-item-title aui-font-size-14">兑换币收益</div>
                                <div class="aui-list-item-right">{{dataInfo.turnover_exchange_amount | moneyFilter}}</div>
                            </div>
                        </div>
                    </div>
                </li>

            </ul>
        </div>

        <div style="position:fixed;top:0;width:100vw;height:100vh;opacity:0.6;background:#999;z-index:12;display:none" id="shopCenterbg" onclick="hidden_tost()"></div>
        <div style="position:fixed;z-index:999;top:30vh;left:20vw;display:none" id="shopCenterTost">
            <img src="" alt="" class="shopCenterImg" style="width:60vw;">
        </div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/zepto.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript" src="../../script/utils.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/aui-tab.js"></script>
<script type="text/javascript" src="../../script/aui-scroll.js"></script>
<script type="text/javascript" src="../../script/aui-pull-refresh.js"></script>
<script type="text/javascript">
    function hidden_tost() {
        $api.css(shopCenterbg, 'display:none');
        $api.css(shopCenterTost, 'display:none');
    }

    function tost_code() {
        $api.css(shopCenterbg, 'display:block');
        $api.css(shopCenterTost, 'display:block');
    }

    function Integralbenefits() {
        api.openWin({
            name: 'Integralbenefits',
            url: './Integralbenefits.html',
        });
    }

    function exchangeEarnings() {
        api.openWin({
            name: 'exchangeEarnings',
            url: './exchangeEarnings.html',
        });
    }

    function storeTurnover() {
        api.openWin({
            name: 'storeTurnover',
            url: './headerone.html',
            pageParam: {
                msg: '店铺营业额',
                url: './storeTurnover.html'
            }
        });

    }

    function convertibleCurrency() {
        api.openWin({
            name: 'convertibleCurrency',
            url: './convertibleCurrency.html',
        });
    }

    function storeIntegral() {
        api.openWin({
            name: 'storeIntegral',
            url: './storeIntegral.html',
        });
    }

    function storeTheBalance() {
        api.openWin({
            name: 'storeTheBalance',
            url: './storeTheBalance.html',
        });

    }

    function uploadCommodity() {
        api.openWin({
            name: 'uploadCommodity',
            url: './headerone.html',
            pageParam: {
                msg: '商品上传',
                url: './uploadCommodity.html'
            }
        });

    }

    function commodityControl(num) {
        api.openWin({
            name: 'commodityControl',
            url: './headerFive.html',
            pageParam: {
                msg: '商品管理('+num+')',
                text: '编辑',
                url: './commodityControl.html'
            }
        });

    }


    function share_commodity(num) {
      api.openWin({
          name: 'share_commodity',
          url: './headerFive.html',
          pageParam: {
              msg: '商品管理('+num+')',
              text: '编辑',
              url: './share_commodity.html'
          }
      });
    }

    function exchange_commodity(num) {
      api.openWin({
          name: 'exchange_commodity',
          url: './headerFive.html',
          pageParam: {
              msg: '商品管理('+num+')',
              text: '编辑',
              url: './exchange_commodity.html'
          }
      });
    }

    function orderNumber() {
        api.openWin({
            name: 'storeOrderList',
            url: './headerone.html',
            pageParam: {
                msg: '全部订单',
                url: './storeOrderList.html'
            }
        });

    }


    apiready = function() {
    //  console.log(JSON.stringify(api))
        new Vue({
            el: '#app',
            data: {
                dataInfo: {}
            },
            methods: {
                goback:function() {
                    api.closeWin();
                },
                storeTheData:function() {
                    api.openWin({
                        name: 'storeTheData',
                        url: './headerone.html',
                        pageParam: {
                            msg: '店铺资料',
                            url: './storeTheData.html'
                        }
                    });

                },
                shopCenterMsg:function() {
                    var _this = this;
                    api.ajax({
                        url: window.Url.Freestore_storeinfo,
                        method: 'post',
                        data: {
                            values: {
                                token: $api.getStorage('token')
                            }

                        }
                    }, function(ret, err) {
                        // alert( JSON.stringify( ret ) );
                        if (ret.re == 1) {
                            _this.dataInfo = ret.data;
                            $api.setStorage('storeId', ret.data.store_info.store_id);
                            $('.shopCenterImg').attr("src", ret.data.store_info.code)

                        } else {
                            api.toast({
                                msg: ret.info,
                                duration: 2000,
                                location: 'bottom'
                            });
                            setTimeout(function(){
                              api.closeWin({});
                            },2000)

                        }
                    });

                },
                //刷新
                setRefresh:function() {
                    var pullRefresh = new auiPullToRefresh({
                        container: document.querySelector('.aui-refresh-content'),
                        triggerDistance: 100
                    }, function(ret) {

                        if (ret.status == "success") {
                            setTimeout(function() {
                                pullRefresh.cancelLoading(); //刷新成功后调用此方法隐藏
                            }, 1500)
                        }
                    })
                },
                //调转店铺服务费
                servercharge:function(){
              //  api.openWin({
              //      name: 'ShopServiceCharge',
              //      url: './ShopServiceCharge.html'
              //  });
               api.openWin({
                 name: 'ShopServiceCharge',
                 url: './five_frame_header2.html',
                 rect: {
                   x:0,
                   y:0,
                   w:'auto',
                   h:'auto'
                 },
                 pageParam: {
                     type: '店铺服务费',
                     name:'shopServiceCharge'
                 }
               })

             }
            },

            mounted:function() {
                this.shopCenterMsg();
                this.setRefresh();
            },
            filters: {
                moneyFilter:function(value) {
                    if (value != undefined) return Base64.decode(value).slice(3, -5)
                }
            }
        })
    };
</script>

</html>
